Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bugsnag/core

Package Overview
Dependencies
Maintainers
9
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bugsnag/core

Core classes and utilities for Bugsnag notifiers

  • 7.25.0
  • npm
  • Socket score

Version published
Maintainers
9
Created

What is @bugsnag/core?

@bugsnag/core is a core library for the Bugsnag error monitoring service. It provides the essential functionality for capturing and reporting errors in your applications. This package is typically used as a dependency for other Bugsnag notifier packages that are specific to different platforms (e.g., JavaScript, React Native, etc.).

What are @bugsnag/core's main functionalities?

Initializing Bugsnag

This code initializes the Bugsnag client with your API key, allowing you to start capturing and reporting errors.

const Bugsnag = require('@bugsnag/core');
const bugsnagClient = Bugsnag.createClient({ apiKey: 'YOUR_API_KEY' });

Notifying Errors

This code sends a notification to Bugsnag about an error. This is useful for capturing and reporting errors that occur in your application.

bugsnagClient.notify(new Error('Test error'));

Adding Metadata

This code adds custom metadata to the error report, which can be useful for providing additional context about the error.

bugsnagClient.notify(new Error('Test error'), event => {
  event.addMetadata('account', {
    id: 123,
    name: 'Acme Co'
  });
});

Breadcrumbs

This code leaves a breadcrumb, which is a log of actions that happened before an error occurred. Breadcrumbs help in understanding the sequence of events leading up to an error.

bugsnagClient.leaveBreadcrumb('User clicked button', { buttonName: 'Submit' });

Other packages similar to @bugsnag/core

FAQs

Package last updated on 03 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc